package com.quick.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.quick.base.KeyValue;
import com.quick.base.Page;
import com.quick.base.Search;
import com.quick.sys.domain.dto.SysRoleDTO;
import com.quick.sys.domain.pojo.SysRole;
import com.quick.sys.domain.search.SysRoleSearch;
import com.quick.sys.domain.vo.SysRoleVo;
import com.quick.util.QuickTool;

import java.util.List;
import java.util.Map;

public interface ISysRoleService {
	default void queryWrapper(QueryWrapper<SysRole> queryWrapper, SysRoleSearch search) {
		if (QuickTool.notNull(search.getKey())) {
			queryWrapper.lambda().like(SysRole::getName, search.getKey());
		}
	}

	Map<Integer, SysRoleVo> loadRole(List<Integer> roleIds);

	Page<SysRoleVo> search(Search<SysRoleSearch> search);

	Boolean saveSysRole(SysRoleDTO role);

	SysRoleVo queryById(Long id);

	Boolean delById(Long id);

	Boolean batchDel(List<Long> ids);

	List<KeyValue> loadAll();

	List<Integer> selectMenuByRoles(List<Integer> roleIds);	
}
